var express = require("express"),
    bodyParser = require('body-parser'),
    //multer  = require('multer'),
    cookieParser = require('cookie-parser'),
    ejs     = require("ejs"),
    path    = require("path");
var app = express();

// view engine setup
app.set('views', path.join(__dirname, 'page'));
app.engine('.html', ejs.__express);
app.set('view engine', 'html');
app.use(cookieParser());
//静态资源
app.use(express.static(path.join(__dirname,'assets')));
// 创建 application/x-www-form-urlencoded 编码解析
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
//app.use(multer({ dest: '/tmp/'}).array('image'));

require('./routers')(app);

module.exports = app;